<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			// #ifndef H5
			wx.showShareMenu({
				withShareTicket:true,
				//设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
				menus:["shareAppMessage","shareTimeline"]
			})
			// #endif
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		onLoad() {
			
			
			
		},
		//发送给朋友
		onShareAppMessage(res) {
		  return {
		      title:'新想购',
		      success(res){
		          uni.showToast({
		              title:'分享成功'
		          })
		      },
		      fail(res){
		          uni.showToast({
		              title:'分享失败',
		              icon:'none'
		          })
		      }
		  }
		},
		
		//uniapp微信小程序分享页面到微信朋友圈
		onShareTimeline(res) {
		  return {
		      title:'新想购',
		      query:'',
		      success(res){
		          uni.showToast({
		              title:'分享成功'
		          })
		      },
		      fail(res){
		          uni.showToast({
		              title:'分享失败',
		              icon:'none'
		          })
		      }
		  }
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "colorui/main.css";
	@import "colorui/icon.css";
	/* #ifdef MP-ALIPAY */
	@import "uview-ui/index.scss";
	/* #endif */
</style>
